gtk-demo: Add another shortcuts window example
authorMatthias Clasen <mclasen@redhat.com>
Tue, 15 Dec 2015 23:39:39 +0000 (18:39 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 15 Dec 2015 23:39:39 +0000 (18:39 -0500)
The boxes shortcuts, taken straight from boxes.
This demonstrates a problem with view filtering.

demos/gtk-demo/demo.gresource.xml
demos/gtk-demo/shortcuts-boxes.ui [new file with mode: 0644]
demos/gtk-demo/shortcuts.c
demos/gtk-demo/shortcuts.ui

index 4dea3a0d826d17a4b35bb7257e9cac67592eed4a..d0e80f2b34d26950a02c655c79a71230fa0d1b9d 100644 (file)
@@ -96,6 +96,7 @@
     <file>shortcuts-builder.ui</file>
     <file>shortcuts-gedit.ui</file>
     <file>shortcuts-clocks.ui</file>
+    <file>shortcuts-boxes.ui</file>
   </gresource>
   <gresource prefix="/revealer">
     <file>revealer.ui</file>
diff --git a/demos/gtk-demo/shortcuts-boxes.ui b/demos/gtk-demo/shortcuts-boxes.ui
new file mode 100644 (file)
index 0000000..6bcaf8a
--- /dev/null
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.17 -->
+
+  <object class="GtkShortcutsWindow" id="shortcuts-boxes">
+    <property name="modal">1</property>
+    
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <property name="section-name">shortcuts</property>
+        <property name="max-height">12</property>
+
+        <!-- Overview shortcuts -->
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Overview</property>
+            <property name="view">overview</property>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">F1</property>
+                <property name="title" translatable="yes">Help</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;n</property>
+                <property name="title" translatable="yes">Create a new box</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;f</property>
+                <property name="title" translatable="yes">Search</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;k</property>
+                <property name="title" translatable="yes">Keyboard shortcuts</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;q</property>
+                <property name="title" translatable="yes">Close Window/Quit Boxes</property>
+              </object>
+            </child>
+          </object>
+        </child>
+
+        <!-- Wizard and Properties shortcuts -->
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Box Creation and Properties</property>
+            <property name="view">wizard</property>
+
+            <!-- LTR -->
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">ltr</property>
+                <property name="accelerator">&lt;Alt&gt;Right</property>
+                <property name="title" translatable="yes">Switch to the next page</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">ltr</property>
+                <property name="accelerator">&lt;Alt&gt;Left</property>
+                <property name="title" translatable="yes">Switch to the previous page</property>
+              </object>
+            </child>
+
+            <!-- RTL -->
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">rtl</property>
+                <property name="accelerator">&lt;Alt&gt;Left</property>
+                <property name="title" translatable="yes">Switch to the next page</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">rtl</property>
+                <property name="accelerator">&lt;Alt&gt;Right</property>
+                <property name="title" translatable="yes">Switch to the previous page</property>
+              </object>
+            </child>
+          </object>
+        </child>
+
+        <!-- Display shortcuts -->
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes">Box Display</property>
+            <property name="view">display</property>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">Control_L+Alt_L</property>
+                <property name="title" translatable="yes">Grab/Ungrab keyboard</property>
+              </object>
+            </child>
+
+            <!-- LTR -->
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">ltr</property>
+                <property name="accelerator">&lt;Alt&gt;Left</property>
+                <property name="title" translatable="yes">Back to overview</property>
+              </object>
+            </child>
+
+            <!-- RTL -->
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="direction">rtl</property>
+                <property name="accelerator">&lt;Alt&gt;Right</property>
+                <property name="title" translatable="yes">Back to overview</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;q</property>
+                <property name="title" translatable="yes">Close window/Quit Boxes</property>
+              </object>
+            </child>
+
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">F11</property>
+                <property name="title" translatable="yes">Fullscreen/Restore from fullscreen</property>
+              </object>
+            </child>
+          </object>
+        </child>
+
+      </object>
+    </child>
+  </object>
+
+</interface>
index 672998449aa7922b7f3fcd9d18e2f0a4d29ed97b..dbe02f66e52cb6eeef40a19292194a073568f4bb 100644 (file)
@@ -49,6 +49,24 @@ clocks_shortcuts_stopwatch (GtkWidget *window)
   show_shortcuts (window, "shortcuts-clocks", "stopwatch");
 }
 
+static void
+boxes_shortcuts (GtkWidget *window)
+{
+  show_shortcuts (window, "shortcuts-boxes", NULL);
+}
+
+static void
+boxes_shortcuts_wizard (GtkWidget *window)
+{
+  show_shortcuts (window, "shortcuts-boxes", "wizard");
+}
+
+static void
+boxes_shortcuts_display (GtkWidget *window)
+{
+  show_shortcuts (window, "shortcuts-boxes", "display");
+}
+
 GtkWidget *
 do_shortcuts (GtkWidget *do_widget)
 {
@@ -73,6 +91,9 @@ do_shortcuts (GtkWidget *do_widget)
                                         "gedit_shortcuts", G_CALLBACK (gedit_shortcuts),
                                         "clocks_shortcuts", G_CALLBACK (clocks_shortcuts),
                                         "clocks_shortcuts_stopwatch", G_CALLBACK (clocks_shortcuts_stopwatch),
+                                        "boxes_shortcuts", G_CALLBACK (boxes_shortcuts),
+                                        "boxes_shortcuts_wizard", G_CALLBACK (boxes_shortcuts_wizard),
+                                        "boxes_shortcuts_display", G_CALLBACK (boxes_shortcuts_display),
                                         NULL);
       gtk_builder_connect_signals (builder, NULL);
       window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
index da480c78abc219625e9a52000a0fd43c9e56e265..cb64e1e65854bce48dc5d7432dc478ee91ec5667 100644 (file)
             <signal name="clicked" handler="clocks_shortcuts_stopwatch" swapped="1" object="window1"/>
           </object>
         </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Boxes</property>
+            <signal name="clicked" handler="boxes_shortcuts" swapped="1" object="window1"/>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Boxes - Wizard</property>
+            <signal name="clicked" handler="boxes_shortcuts_wizard" swapped="1" object="window1"/>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Boxes - Display</property>
+            <signal name="clicked" handler="boxes_shortcuts_display" swapped="1" object="window1"/>
+          </object>
+        </child>
       </object>
     </child>
   </object>